# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

package(
    default_visibility = ["//visibility:public"],
    licenses = ["notice"],
)

cc_library(
    name = "annotation_parser",
    srcs = [
        "annotation_parser.cc",
    ],
    hdrs = [
        "annotation_parser.h",
    ],
    deps = [
        "//gutil/gutil:status",
        "@com_google_absl//absl/status:statusor",
        "@com_google_absl//absl/strings",
    ],
)

cc_test(
    name = "annotation_parser_test",
    srcs = ["annotation_parser_test.cc"],
    deps = [
        ":annotation_parser",
        "//gutil/gutil:status_matchers",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/status:statusor",
        "@com_google_absl//absl/strings",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_library(
    name = "ir",
    srcs = [
        "ir.cc",
    ],
    hdrs = [
        "ir.h",
    ],
    deps = [
        "//gutil/gutil:proto",
        "//gutil/gutil:status",
        "//p4_pdpi:ir_cc_proto",
        "//p4_pdpi:translation_options",
        "//p4_pdpi/netaddr:ipv4_address",
        "//p4_pdpi/netaddr:ipv6_address",
        "//p4_pdpi/netaddr:mac_address",
        "//p4_pdpi/string_encodings:byte_string",
        "@com_github_p4lang_p4runtime//:p4info_cc_proto",
        "@com_github_p4lang_p4runtime//:p4runtime_cc_proto",
        "@com_github_p4lang_p4runtime//:p4types_cc_proto",
        "@com_google_absl//absl/algorithm:container",
        "@com_google_absl//absl/container:btree",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/status:statusor",
        "@com_google_absl//absl/strings",
        "@com_google_googleapis//google/rpc:code_cc_proto",
        "@com_google_protobuf//:protobuf",
        "@com_google_protobuf//third_party/utf8_range:utf8_validity",
    ],
)

cc_test(
    name = "ir_test",
    srcs = ["ir_test.cc"],
    deps = [
        ":ir",
        "//gutil/gutil:proto",
        "//gutil/gutil:proto_matchers",
        "//gutil/gutil:status_matchers",
        "//p4_pdpi:ir_cc_proto",
        "//p4_pdpi/netaddr:ipv6_address",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/status:statusor",
        "@com_google_absl//absl/strings",
        "@com_google_googletest//:gtest_main",
        "@com_google_protobuf//:protobuf",
    ],
)
